package com.tdkj.model.decorate;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;

/**
 * 
 */
@Entity
@Table(name = "decorate_layout_module_config")
public class BeanLayoutModuleConfig extends BaseEntity {
	
	private BeanLayout layout;
	
	//有序
	private List<BeanModule> modules;

	
	@ManyToOne(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH})
	@JoinColumn(name="layout_id")
	public BeanLayout getLayout() {
		return layout;
	}

	public void setLayout(BeanLayout layout) {
		this.layout = layout;
	}

	@ManyToMany(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH})
	@JoinTable(name="decorate_layout_module_config_to_module", joinColumns={@JoinColumn(name="config_id")},inverseJoinColumns={@JoinColumn(name="module_id")})
	public List<BeanModule> getModules() {
		return modules;
	}

	public void setModules(List<BeanModule> modules) {
		this.modules = modules;
	}
	
	

}